import java.util.Scanner;
public class StudentGrades{
 // Demonstrating Nested Loops
  // Each of 4 students has taken 3 quizzes. Find the Quiz average of each student
 public static void main(String[] args){
      final int NUMSTUDENTS = 4, NUMQUIZES = 3;
      double grade, studentTotal, studentAverage;
      int m, n;
      
      Scanner scanner = new Scanner(System.in);
    
      for(m = 1; m <= NUMSTUDENTS; m++)
      {
          studentTotal = 0.0;
          for(n = 1; n <= NUMQUIZES; n++)
          {
             System.out.printf("Enter QuizGrade#%d for student#%d: ", n, m);
             grade = scanner.nextDouble();
             studentTotal += grade;
          }
          studentAverage = studentTotal / NUMQUIZES;
          System.out.printf("The average for student#%d is %.2f\n\n", m, studentAverage);  
      }
   }
}

